package org.Vancl.Dao.ImpI;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;



import org.Vancl.Dao.typeDao;
import org.Vancl.entity.type;
import org.Vancl.utils.BaseDao;

public class typeDaoImpI extends BaseDao implements typeDao {

	
	public List<type> getAll() {
		String sql="SELECT * FROM `type`";
		ResultSet rs=super.executeQuery(sql);
		List<type> typelist=new ArrayList();
		try {
			while(rs.next()) {
				type type=new type();
				type.setTypeid(rs.getInt("typeid"));
				type.setTypename(rs.getString("typename"));
				typelist.add(type);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}finally {
			try {
				super.CloseAll(rs, rs.getStatement().getConnection(), rs.getStatement());
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}
		return typelist;
	}

}
